package com.jcfy.project.module.service.impl;

import java.util.List;
import com.jcfy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcfy.project.module.mapper.TWithdrawMapper;
import com.jcfy.project.module.domain.TWithdraw;
import com.jcfy.project.module.service.ITWithdrawService;

/**
 * 提现Service业务层处理
 *
 * @author jiangfeng
 * @date 2020-08-05
 */
@Service
public class TWithdrawServiceImpl implements ITWithdrawService {
    @Autowired
    private TWithdrawMapper tWithdrawMapper;

    /**
     * 查询提现
     *
     * @param withdrawId 提现ID
     * @return 提现
     */
    @Override
    public TWithdraw selectTWithdrawById(Long withdrawId) {
        return tWithdrawMapper.selectTWithdrawById(withdrawId);
    }

    /**
     * 查询提现列表
     *
     * @param tWithdraw 提现
     * @return 提现
     */
    @Override
    public List<TWithdraw> selectTWithdrawList(TWithdraw tWithdraw) {
        return tWithdrawMapper.selectTWithdrawList(tWithdraw);
    }

    /**
     * 新增提现
     *
     * @param tWithdraw 提现
     * @return 结果
     */
    @Override
    public int insertTWithdraw(TWithdraw tWithdraw) {
        tWithdraw.setCreateTime(DateUtils.getNowDate());
        return tWithdrawMapper.insertTWithdraw(tWithdraw);
    }

    /**
     * 修改提现
     *
     * @param tWithdraw 提现
     * @return 结果
     */
    @Override
    public int updateTWithdraw(TWithdraw tWithdraw) {
        tWithdraw.setUpdateTime(DateUtils.getNowDate());
        return tWithdrawMapper.updateTWithdraw(tWithdraw);
    }

    /**
     * 批量删除提现
     *
     * @param withdrawIds 需要删除的提现ID
     * @return 结果
     */
    @Override
    public int deleteTWithdrawByIds(Long[] withdrawIds) {
        return tWithdrawMapper.deleteTWithdrawByIds(withdrawIds);
    }

    /**
     * 删除提现信息
     *
     * @param withdrawId 提现ID
     * @return 结果
     */
    @Override
    public int deleteTWithdrawById(Long withdrawId) {
        return tWithdrawMapper.deleteTWithdrawById(withdrawId);
    }
}
